const Sequelize = require('sequelize');
const NODE_ENV = process.env.NODE_ENV || 'development';
const { host, database, username, password } = require('../../resources/mysql-config')[NODE_ENV];

const sequelize = new Sequelize(database, username, password, {
    host: host,
    dialect: 'mysql',

    pool: {
        max: 5,
        min: 0,
        acquire: 30000,
        idle: 10000
    },

    // 请参考 Querying - 查询 操作符 章节
    operatorsAliases: false
});


export { sequelize };